package com.powerhua.privilege.logic.impl;

import java.util.ArrayList;
import java.util.List;

import com.powerhua.privilege.dao.UserDao;
import com.powerhua.privilege.domain.User;
import com.powerhua.privilege.logic.UserManager;

public class UserManagerImpl implements UserManager {

	private UserDao userDao;
	
	public void setUserDao(UserDao dao) {
		this.userDao = dao;
	}
    
    public UserDao getUserDao() {
        return this.userDao;
    }

	public void create(User user) {
		// TODO
	}

	public void delete(User user) {
		// TODO
	}

	public void update(User user) {
		// TODO
	}
	
	public List findUsers(User user, int start, int offset) {       
        List<User> list = new ArrayList<User>();
        if (user != null && user.getUserId() != null && !"".equals(user.getUserId())) {
            User u = (User) userDao.findUserById(user.getUserId());
            list.add(u);
            return list;
        } else {
            return userDao.getUserList(start, offset);
        }
	}

	public User loginCheckUser(User user) {
		// TODO Auto-generated method stub
		return null;
	}

}
